﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
	
    <!-- Resource dictionary entries should be defined here. -->
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Colors.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    <ControlTemplate x:Key="ValidationToolTipTemplate">
		<Grid x:Name="Root" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="OpenStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition From="Closed" GeneratedDuration="0:0:0.4" To="Open"/>
                        <VisualTransition From="Open" GeneratedDuration="0:0:0.4" To="Closed"/>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Closed">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Root">
                                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Open"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

			<Grid.ColumnDefinitions>
	        	<ColumnDefinition Width="18"/>
	        	<ColumnDefinition Width="*"/>
	        </Grid.ColumnDefinitions>
            <Border CornerRadius="0" BorderThickness="1" Grid.ColumnSpan="2">
	            <Border.BorderBrush>
	                <SolidColorBrush Color="{StaticResource Application_Control_BorderBrush}"/>
	            </Border.BorderBrush>
	            <Border.Background>
                    <SolidColorBrush Color="{StaticResource Application_Control_Background}"/>
	            </Border.Background>
			</Border>

            <TextBlock x:Name="Contect" Grid.Column="1" UseLayoutRounding="false" Margin="0,2,5,2" MaxWidth="250" TextWrapping="Wrap" Height="Auto" 
					   VerticalAlignment="Center" Text="{Binding (Validation.Errors)[0].ErrorContent}">
	            <TextBlock.Foreground>
	                <SolidColorBrush Color="{StaticResource Application_Control_Foreground}"/>
	            </TextBlock.Foreground>
            </TextBlock>
            <Ellipse Margin="0" Stroke="{x:Null}" Width="10" Height="10" StrokeThickness="0">
                <Ellipse.Fill>
                    <SolidColorBrush Color="{StaticResource Application_TextBox_BorderBrush_ValidationError}"/>
                </Ellipse.Fill>
            </Ellipse>
            <TextBlock Margin="0" TextWrapping="Wrap" Text="!" d:LayoutOverrides="Width, Height" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="8" FontWeight="Bold">
	            <TextBlock.Foreground>
	                <SolidColorBrush Color="{StaticResource Application_Control_Foreground}"/>
	            </TextBlock.Foreground>
            </TextBlock>
        </Grid>
    </ControlTemplate>
</ResourceDictionary>